/**
 * Friendly Interactive Recursion Educator (FIRE)
 * COMS 4115: Programming Languages & Translators
 * Prof. Aho
 * 
 * @author Brian Lu
 * @author Sahar Hasan
 * @author Steve Hehl
 * @author Tristan Naumann
 * @version 2009-05-12
 */
package fire;
import java.util.ArrayList;

public class Node {

        private String call;
        private ArrayList<Node> children = new ArrayList<Node>();
        private String retVal;
        private int childNum;
        private Node parent;
        private int depth;
        private int xpos;
        private int ypos;
        private int width;
        private int startingPos;

        public Node() {
                
        }

        public void addChild(Node n)
        {
                children.add(n);
        }
        
        public ArrayList<Node> getChildren()
        {
        	return children;
        }
 
        public void setChildNum(int n)
        {
        	childNum = n;
        }
        
        public int getChildNum()
        {
        	return childNum;
        }
        
        public void setCall(String c)
        {
        	call = c;
        }
         
        public String getCall()
        {
        	String[] splitString = call.split(" VALUES: ");
        	return " CALL: " + splitString[0];
    	}
        
        public String getValues()
        {
        	String[] splitString = call.split(" VALUES: ");
    		String parsedString = "PARAMETERS:";
    		
    		String[] vars = splitString[1].split(" ");
    		
    		for(int i = 0; i < vars.length; i++)
    		{
    			if(vars[i].substring(0,5).equals("fire_"))
    				vars[i] = vars[i].substring(5);
    		}
    		
    		for(int i = 0; i < vars.length; i++)
    		{
    			parsedString += (" " + vars[i]);
    		}
    		
    		return parsedString;
        }
        
        public void setRetVal(String r)
        {
        	retVal = r;
        }
        
        public String getRetVal()
        {
        	return retVal;
        }
        
        public void setDepth(int d)
        {
        	depth = d;
        }
        
        public int getDepth()
        {
        	return depth;
        }
        
        public void setXpos(int x)
        {
        	xpos = x;
        }
        
        public int getXpos()
        {
        	return xpos;
        }
        
        public void setYpos(int y)
        {
        	ypos = y;
        }
        
        public int getYpos()
        {
        	return ypos;
        }
        
        public void setWidth(int w)
        {
        	width = w;
        }
        
        public int getWidth()
        {
        	return width;
        }
        
        public void setStartingPos(int s)
        {
        	startingPos = s;
        }
        
        public int getStartingPos()
        {
        	return startingPos;
        }
        
        public void setParent(Node p)
        {
        	parent = p;
        }
        
        public Node getParent()
        {
        	return parent;
        }
}
